

window.onload=function(){


    var pages = document.getElementsByClassName("page");
    var wrap_body = document.getElementById("wrap_body");
    var len = document.documentElement.clientHeight;
    var main = document.getElementById("main");
    var pageIndex=1;
    wrap_body.style.height = len + "px";
    var pageWidth = document.documentElement.clientWidth;
    var pageHeight = document.documentElement.clientHeight;
    // var event_can = document.getElementById("event_can");
    // var event_ctx = event_can.getContext("2d");
    // event_can.width = pageWidth;
    // event_can.height = pageHeight;
    // var nodes = [];
    // var line = [];
    // var rakes = [];//Ð±ÂÊ
    // var years = document.getElementsByClassName("years");
    // var event_points = document.getElementsByClassName("point");
    // var event_years = document.getElementById("event_years");
    // var event_detail = document.getElementById("event_detail");
    // var inner = document.getElementById("inner");
    // var inner_item = document.getElementsByClassName("inner_item");
    // var event_but_next = document.getElementById("event_next");
    // var event_but_prev = document.getElementById("event_prev");
    // var indicator_item = document.getElementsByClassName("indicator_item");
    // var event_index = 0;
    // var event_end = 0;
    // var event_back = document.getElementById("event_back");
    // var event_image = document.getElementsByClassName("event_image");


    for(var i=0; i<pages.length; i++){
        pages[i].style.height = len + "px";
    }
    window.onresize=function(){
        len = document.documentElement.clientHeight;
        wrap_body.style.height = len + "px";
        for(var i=0; i<pages.length; i++){
        pages[i].style.height = len + "px";

        }
        main.style.transition = "top 0s ease-in";
        main.style.top = (-(pageIndex-1) * len) + "px";

        drawDash();
        drawArrow();
        main.style.transition = "top 0.3s ease-in";

        drawPath();

        pageWidth = document.documentElement.clientWidth;
        pageHeight = document.documentElement.clientHeight;


        inner.style.transition = "left 0s";
        event_detail.style.width = pageWidth + "px" ;
        event_detail.style.height = pageHeight + "px";
        for(let i=0;i<inner_item.length;i++){
            inner_item[i].style.width = pageWidth + "px";
            inner_item[i].style.height = pageHeight + "px";
        }
        inner.style.width = pageWidth * inner_item.length +"px";
        inner.style.left = (-event_index * pageWidth) + "px";
        setTimeout(function(){
            inner.style.transition = "left 1s";
        },100);

    }


    function getEventListener(){
       if(navigator.userAgent.toLowerCase().indexOf("firefox") != -1){//»ðºüä¯ÀÀÆ÷
            document.addEventListener("DOMMouseScroll",scrollFun); //firefox
        }else if(document.addEventListener){//addEventListener¡ª¡ª¼æÈÝ£ºfirefox,chrome,IE,safari,opera£»
            document.addEventListener("mousewheel",scrollFun,false);
        }else if(document.attachEvent){//attachEvent¡ª¡ª¼æÈÝ£ºIE7¡¢IE8£»
            document.attachEvent("onmousewheel",scrollFun);//IE,Opera,Google,ChromeºÍSafari
        }else{
            document.onmousewheel = scrollFun;
        }
    }
    getEventListener();




    var now = 0;  //记录main开始滚动时间
    var endTime = 0;
    function scrollFun(e){
        now = parseInt(main.style.top);
        var startTime = new Date().getTime();//»ñÈ¡µ±Ç°Ê±¼ä  
        var event = e || window.event;//¼æÈÝ¸öä¯ÀÀÆ÷£¬»ñµÃÊÂ¼þ¶ÔÏó  
        var dir = event.detail || -event.wheelDelta;//Firefox Ê¹ÓÃdetail£¬ÆäÓàËÄÀàÊ¹ÓÃwheelDelta
        //detailÖ»È¡¡À3£¬wheelDeltaÖ»È¡¡À120
        if(startTime - endTime > 300){ //0.3ÃëÖ»Ö´ÐÐÒ»´Î·­Ò³
            if(dir>0 && now > -(pages.length-1)*len){ //ÏòÏÂ·­Ò³
                now -= len;
                main.style.top = now +"px";
                endTime = new Date().getTime();
                pageIndex++;
                showMenu();
            }else if(dir<0 && now < 0){//ÏòÉÏ·­Ò³
                now += len;
                main.style.top = now +"px";
                endTime = new Date().getTime();
                pageIndex--;
                showMenu();
            }
        }else{
              event.preventDefault();//È¡ÏûÄ¬ÈÏÊÂ¼þ
         }
    }

   var nav_can = document.getElementById("nav_can");
   var nav_ctx = nav_can.getContext("2d");
   function nav_drawcirle(){//导航条白色圆圈
        nav_ctx.lineWidth=2;
        nav_ctx.strokeStyle="#fff";
        nav_ctx.beginPath();
        nav_ctx.arc(20,23,12,0,Math.PI*2);
        nav_ctx.stroke();
        nav_ctx.closePath();
   }
   nav_drawcirle();

   nav_can.onmouseover=function(){//触摸导航条重新画灰色圆圈
        nav_ctx.lineWidth=2;
        nav_ctx.strokeStyle="#8c8c8c";
        nav_ctx.beginPath();
        nav_ctx.arc(20,23,12,0,Math.PI*2);
        nav_ctx.stroke();
        nav_ctx.closePath();
        delaydraw(0);
   }
   function delaydraw(begin){//触摸导航条缓慢画白色圆圈
        var end = begin+Math.PI/10;
        nav_ctx.lineWidth=2;
        nav_ctx.strokeStyle="#fff";
        nav_ctx.beginPath();
        nav_ctx.arc(20,23,12,begin,end,false);
        nav_ctx.stroke();
        var timer = setTimeout(function(){delaydraw(end)},10);
        if(end>=(Math.PI*2)){
            clearTimeout(timer);
        }
   }

   var navbar_menu = document.getElementById("navbar_menu");
   var menu_items = document.getElementsByClassName("navbar_menu_item");
   var menu_item_span = document.getElementsByClassName("menu_item_span");
   nav_can.onclick=function(){//点击圆圈出现菜单
        for(let i=0;i<menu_items.length;i++){
            menu_items[i].style.display = "block";
        }
   }

   for(let i=0;i<menu_items.length;i++){//点击菜单条项目
        menu_items[i].onclick=function(){

            main.style.top = -(len*i) + "px";
            pageIndex = i+1;
            showMenu();
        }
   }
   function showMenu(){//菜单条显示颜色
        for(let i=0;i<menu_items.length;i++){
            if(menu_items[i].style.top == "-100%"){
                menu_items[i].style.top = 0;
                break;
            }
            //
            //menu_item_span[i].classList.remove("nav_active");

        }
        menu_items[pageIndex-1].style.top = "-100%";
        //menu_item_span[pageIndex-1].classList.add("nav_active");
   }
   showMenu();


    var home_can = document.getElementById("home_can");
    var ctx = home_can.getContext("2d");
    function drawDash(){//首页画虚线

        var width = document.documentElement.clientWidth;
        var height = document.documentElement.clientHeight;
        home_can.height = height;
        home_can.width = width;
        ctx.setLineDash([10,10]);
        ctx.lineWidth=2;
        ctx.strokeStyle="#737373";
        ctx.beginPath();
        ctx.moveTo(width*0.56,height*0.5);
        ctx.lineTo(width*0.7,height*0.3);
        ctx.lineTo(width*0.82,height*0.48);
        ctx.lineTo(width*0.89,height*0.78);
        ctx.lineTo(width*0.6,height*0.799);
        ctx.lineTo(width*0.42,height*0.65);
        ctx.lineTo(width*0.56,height*0.5);
        ctx.lineTo(width*0.6,height*0.799);
        ctx.lineTo(width*0.73,height*0.7);
        ctx.lineTo(width*0.89,height*0.78);
        ctx.moveTo(width*0.56,height*0.5);
        ctx.lineTo(width*0.82,height*0.48);
        ctx.lineTo(width*0.73,height*0.7);
        ctx.lineTo(width*0.56,height*0.5);
        ctx.stroke();
        ctx.closePath();
    }
    drawDash();
    function drawArrow(){//首页画箭头

        var width = document.documentElement.clientWidth;
        var height = document.documentElement.clientHeight;
        ctx.beginPath();
        ctx.moveTo(width*0.253,height*0.627);
        ctx.lineTo(width*0.27,height*0.627);
        ctx.lineTo(width*0.27,height*0.615);
        ctx.lineTo(width*0.28,height*0.635);
        ctx.lineTo(width*0.27,height*0.655);
        ctx.lineTo(width*0.27,height*0.643);
        ctx.lineTo(width*0.253,height*0.643);
        ctx.lineTo(width*0.253,height*0.627);
        ctx.fill();
        ctx.closePath();
        var dots = [];
        var rectWidth = width*0.28 - width*0.253+1;
        var rectHeight = height*0.655 - height*0.615+1;
        var imgWidth = width*0.28;
        var imgHeight = height*0.655;
        var img = ctx.getImageData(0,0,imgWidth,imgHeight);
        for(var y=0;y<img.height;y+=4){
            for(var x=0;x<img.width;x+=4){
                var i = (x+y*img.width)*4;
                var dot = {
                    x:0,
                    y:0
                };
                if(img.data[i+3]>=128){
                    dot.x = x;
                    dot.y = y;
                    dots.push(dot);
                }
            }
        }
        ctx.clearRect(width*0.253-1,height*0.615,rectWidth,rectHeight);
        dots.forEach(function(dot){
            ctx.fillStyle = "#68f8c7";
            ctx.shadowBlur=20;
            ctx.shadowColor="#52b996";
            ctx.beginPath();
            ctx.arc(dot.x,dot.y,1.3,0,Math.PI*2);
            ctx.fill();
            ctx.closePath();
        });
    }
    drawArrow();

    function drawPath(){//事件页面画路线
        var x = [];
        var y = [];
        var j = [];
        var k = [];
        nodes = [];
        line = [];
        rakes = [];
        pageWidth = document.documentElement.clientWidth;
        pageHeight = document.documentElement.clientHeight;
        event_can.width = pageWidth;
        event_can.height = pageHeight;
        //»­ÐéÏß
        event_ctx.lineWidth = 1;
        event_ctx.strokeStyle = "#737373";
        event_ctx.setLineDash([8,8]);
        event_ctx.beginPath();
        event_ctx.moveTo(pageWidth*0,pageHeight*0.5);
        event_ctx.lineTo(pageWidth*0.1,pageHeight*0.52);//1
        x[0] = pageWidth*0.1;
        y[0] = pageHeight*0.52;
        event_ctx.lineTo(pageWidth*0.19,pageHeight*0.5);//2
        x[1] = pageWidth*0.19;
        y[1] = pageHeight*0.5;
        event_ctx.lineTo(pageWidth*0.28,pageHeight*0.53);//3
        x[2] = pageWidth*0.28;
        y[2] = pageHeight*0.53;
        event_ctx.lineTo(pageWidth*0.39,pageHeight*0.46);//4
        x[3] = pageWidth*0.39;
        y[3] = pageHeight*0.46;
        event_ctx.lineTo(pageWidth*0.49,pageHeight*0.52);//5
        x[4] = pageWidth*0.49;
        y[4] = pageHeight*0.52;
        event_ctx.lineTo(pageWidth*0.6,pageHeight*0.48);//6
        x[5] = pageWidth*0.6;
        y[5] = pageHeight*0.48;
        event_ctx.lineTo(pageWidth*0.68,pageHeight*0.58);//7
        x[6] = pageWidth*0.68;
        y[6] = pageHeight*0.58;
        event_ctx.lineTo(pageWidth*0.76,pageHeight*0.52);//8
        x[7] = pageWidth*0.76;
        y[7] = pageHeight*0.52;
        event_ctx.lineTo(pageWidth*0.83,pageHeight*0.56);//9
        x[8] = pageWidth*0.83;
        y[8] = pageHeight*0.56;
        event_ctx.lineTo(pageWidth*0.9,pageHeight*0.52);//10
        x[9] = pageWidth*0.9;
        y[9]= pageHeight*0.52;
        event_ctx.lineTo(pageWidth*1,pageHeight*0.56);
        event_ctx.stroke();
        event_ctx.closePath();
        for(i=0;i<10;i++){//´æÔ²ÐÄµã
            var node = {
            x:0,
            y:0
            };
            node.x = x[i];
            node.y = y[i];
            nodes.push(node);
        }


        //»­ÊµÐÄµã
        event_ctx.fillStyle = "#fff";
        event_ctx.setLineDash([0,0]);
        event_ctx.beginPath();
        event_ctx.moveTo(pageWidth*0.1,pageHeight*0.52);
        event_ctx.arc(pageWidth*0.1,pageHeight*0.52,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.19,pageHeight*0.5);
        event_ctx.arc(pageWidth*0.19,pageHeight*0.5,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.28,pageHeight*0.53);
        event_ctx.arc(pageWidth*0.28,pageHeight*0.53,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.39,pageHeight*0.46);
        event_ctx.arc(pageWidth*0.39,pageHeight*0.46,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.49,pageHeight*0.52);
        event_ctx.arc(pageWidth*0.49,pageHeight*0.52,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.6,pageHeight*0.48);
        event_ctx.arc(pageWidth*0.6,pageHeight*0.48,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.68,pageHeight*0.58);
        event_ctx.arc(pageWidth*0.68,pageHeight*0.58,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.76,pageHeight*0.52);
        event_ctx.arc(pageWidth*0.76,pageHeight*0.52,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.83,pageHeight*0.56);
        event_ctx.arc(pageWidth*0.83,pageHeight*0.56,1.5,0,Math.PI*2);
        event_ctx.moveTo(pageWidth*0.9,pageHeight*0.52);
        event_ctx.arc(pageWidth*0.9,pageHeight*0.52,1.5,0,Math.PI*2);
        event_ctx.fill();
        event_ctx.closePath();

        //»­¿ÕÐÄÔ²#00ffb8
        event_ctx.setLineDash([0,0]);
        //event_ctx.lineWidth = 3;
        event_ctx.strokeStyle = "#00ffb8";
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.1,pageHeight*0.52,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.19,pageHeight*0.5,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.28,pageHeight*0.53,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.39,pageHeight*0.46,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.49,pageHeight*0.52,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.6,pageHeight*0.48,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.68,pageHeight*0.58,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.76,pageHeight*0.52,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.83,pageHeight*0.56,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.beginPath();
        event_ctx.arc(pageWidth*0.9,pageHeight*0.52,6,0,Math.PI*2);
        event_ctx.stroke();
        event_ctx.closePath();

        //»­ÊµÏß
        event_ctx.strokeStyle = "#737373";
        event_ctx.beginPath();
        event_ctx.moveTo(pageWidth*0.1,pageHeight*0.52);
        event_ctx.lineTo(pageWidth*0.12,pageHeight*0.37);//1
        j[0] = pageWidth * 0.12;
        k[0] = pageHeight * 0.37;
        event_ctx.moveTo(pageWidth*0.19,pageHeight*0.5);
        event_ctx.lineTo(pageWidth*0.21,pageHeight*0.67);//2
        j[1] = pageWidth*0.21;
        k[1] = pageHeight*0.67;
        event_ctx.moveTo(pageWidth*0.28,pageHeight*0.53);
        event_ctx.lineTo(pageWidth*0.26,pageHeight*0.33);//3
        j[2] = pageWidth*0.26;
        k[2] = pageHeight*0.33;
        event_ctx.moveTo(pageWidth*0.39,pageHeight*0.46);
        event_ctx.lineTo(pageWidth*0.37,pageHeight*0.68);//4
        j[3] = pageWidth*0.37;
        k[3] = pageHeight*0.68;
        event_ctx.moveTo(pageWidth*0.49,pageHeight*0.52);
        event_ctx.lineTo(pageWidth*0.51,pageHeight*0.36);//5
        j[4] = pageWidth*0.51;
        k[4] = pageHeight*0.36;
        event_ctx.moveTo(pageWidth*0.6,pageHeight*0.48);
        event_ctx.lineTo(pageWidth*0.58,pageHeight*0.68);//6
        j[5] = pageWidth*0.58;
        k[5] = pageHeight*0.68;
        event_ctx.moveTo(pageWidth*0.68,pageHeight*0.58);
        event_ctx.lineTo(pageWidth*0.66,pageHeight*0.43);//7
        j[6] = pageWidth*0.66;
        k[6] = pageHeight*0.43;
        event_ctx.moveTo(pageWidth*0.76,pageHeight*0.52);
        event_ctx.lineTo(pageWidth*0.78,pageHeight*0.33);//8
        j[7] = pageWidth*0.78;
        k[7] = pageHeight*0.33;
        event_ctx.moveTo(pageWidth*0.83,pageHeight*0.56);
        event_ctx.lineTo(pageWidth*0.81,pageHeight*0.76);//9
        j[8] = pageWidth*0.81;
        k[8] = pageHeight*0.76;
        event_ctx.moveTo(pageWidth*0.9,pageHeight*0.52);
        event_ctx.lineTo(pageWidth*0.88,pageHeight*0.39);//10
        j[9] = pageWidth*0.88;
        k[9] = pageHeight*0.39;
        event_ctx.stroke();
        event_ctx.closePath();
        for(var i=0;i<10;i++){//´æ»­Ö±ÏßµÄÆðÊ¼µã
            var node = {
                x:0,
                y:0
            };
            node.x = j[i];
            node.y = k[i];
            line.push(node);
        }

        for(var i=0;i<10;i++){//´æÐ±ÂÊ
            var rake = (nodes[i].y-line[i].y)/(nodes[i].x-line[i].x);
            rakes.push(rake);
        }



        //»­ÊµÐÄ·½ÐÎ
        event_ctx.fillStyle = "#00ffb8";
        event_ctx.fillRect(pageWidth*0.119,pageHeight*0.36,6,6);
        event_ctx.fillRect(pageWidth*0.208,pageHeight*0.671,6,6);
        event_ctx.fillRect(pageWidth*0.259,pageHeight*0.329,6,6);
        event_ctx.fillRect(pageWidth*0.368,pageHeight*0.681,6,6);
        event_ctx.fillRect(pageWidth*0.508,pageHeight*0.358,6,6);
        event_ctx.fillRect(pageWidth*0.578,pageHeight*0.681,6,6);
        event_ctx.fillRect(pageWidth*0.658,pageHeight*0.428,6,6);
        event_ctx.fillRect(pageWidth*0.778,pageHeight*0.329,6,6);
        event_ctx.fillRect(pageWidth*0.808,pageHeight*0.761,6,6);
        event_ctx.fillRect(pageWidth*0.878,pageHeight*0.389,6,6);

    }
    drawPath();
//     function event_delayDrawDash(num){//事件页面画虚线圈
//         event_ctx.strokeStyle = "#737373";
//         event_ctx.lineWidth = 1;
//         event_ctx.setLineDash([3,3]);
//         event_ctx.beginPath();
//         event_ctx.arc(nodes[num].x,nodes[num].y,20,0,Math.PI*2);
//         event_ctx.stroke();
//         event_ctx.closePath();
//     }
//     var arc_timer = "";//»ºÂý»­È¦¶¨Ê±Æ÷
//     var delay_arc_timer = ""//ÑÓÊ±»­È¦¶¨Ê±Æ÷
//     function event_delayDrawLine(begin_x,begin_y,num){//事件页面缓慢画实线
//         line_timer = "";//¶¨Ê±Æ÷
//         var x= nodes[num].x-line[num].x;//Ë®Æ½Æ«ÒÆÁ¿
//         event_ctx.lineWidth = 1;
//         event_ctx.strokeStyle = "#fff";
//         event_ctx.setLineDash([0,0]);

//         event_ctx.beginPath();
//         event_ctx.moveTo(begin_x,begin_y);
//         var end_x = begin_x+1/40*(x);
//         var end_y = begin_y+rakes[num]*1/40*(x);
//         event_ctx.lineTo(end_x,end_y);
//         event_ctx.stroke();
//         event_ctx.closePath();
//         line_timer = setTimeout(function(){
//             event_delayDrawLine(end_x,end_y,num);
//         },20);
//         if(x>0){
//             if(end_x+0.5>=nodes[num].x){
//                 clearTimeout(line_timer);
//             }
//         }else{
//             if(end_x-0.5<=nodes[num].x){
//                 clearTimeout(line_timer);
//             }
//         }
//     }
//     function event_delayDrawArc(central_x,central_y,begin){//事件页面画实线圈
//         event_ctx.lineWidth = 1;
//         event_ctx.setLineDash([0,0]);
//         event_ctx.strokeStyle = "#c5c5c5";
//         event_ctx.beginPath();
//         var end = begin+Math.PI/10;
//         event_ctx.arc(central_x,central_y,20,0,end);
//         event_ctx.stroke();
//         event_ctx.closePath();
//         arc_timer = setTimeout(function(){
//             event_delayDrawArc(central_x,central_y,end);
//         },30);
//         if(end>=Math.PI*2){
//             clearTimeout(arc_timer);
//         }
//     }
//     for(let i=0;i<years.length;i++){
//         years[i].onmouseover=function(){
//             event_delayDrawDash(i);
//             event_delayDrawLine(line[i].x,line[i].y,i);
//             delay_arc_timer = setTimeout(function(){
//                 event_delayDrawArc(nodes[i].x,nodes[i].y,0);
//             },800);
//         }
//     }
//     for(let i=0;i<years.length;i++){
//         years[i].onmouseout=function(){
//             pageWidth = document.documentElement.clientWidth;
//             pageHeight = document.documentElement.clientHeight;
//             event_ctx.clearRect(0,0,pageWidth,pageHeight);
//             clearTimeout(line_timer);
//             clearTimeout(delay_arc_timer);
//             clearTimeout(arc_timer);
//             drawPath();
//         }
//     }
//     for(let i=0;i<event_points.length;i++){
//         event_points[i].onmouseover=function(){
//             event_delayDrawDash(i);
//             event_delayDrawArc(nodes[i].x,nodes[i].y,0);
//         }
//     }
//     for(let i=0;i<event_points.length;i++){
//         event_points[i].onmouseout=function(){
//             clearTimeout(arc_timer);
//             pageWidth = document.documentElement.clientWidth;
//             pageHeight = document.documentElement.clientHeight;
//             event_ctx.clearRect(0,0,pageWidth,pageHeight);
//             drawPath();
//         }
//     }
//     for(let i=0;i<years.length;i++){//
//         years[i].onclick=function(){
//             event_years.style.visibility = "hidden";
//             event_years.style.zIndex = "-10";
//             event_detail.style.visibility = "visible";
//             event_detail.style.zIndex = "10";
//             inner.style.transition = "left 0s";
//             event_index = i;
//             inner.style.left = (-i * pageWidth) + "px";
//             event_showButton();
//             showEventPic();
//             setTimeout(function(){
//                inner.style.transition = "left 1s";
//             },100);

//         }
//     }
//     for(let i=0;i<event_points.length;i++){
//         event_points[i].onclick=function(){
//             event_years.style.visibility = "hidden";
//             event_years.style.zIndex = "-10";
//             event_detail.style.visibility = "visible";
//              event_detail.style.zIndex = "10";
//              inner.style.transition = "left 0s";
//              event_index = i;
//              inner.style.left = (-i * pageWidth) + "px";
//              event_showButton();
//              setTimeout(function(){
//                 inner.style.transition = "left 1s";
//              },100);

//         }
//     }

//     event_back.onclick=function(){
//         event_years.style.visibility = "visible";
//         event_years.style.zIndex = "10";
//         event_detail.style.visibility = "hidden";
//         event_detail.style.zIndex = "-10";
//     }




//     event_detail.style.width = pageWidth + "px" ;
//     event_detail.style.height = pageHeight + "px";
//     for(let i=0;i<inner_item.length;i++){
//         inner_item[i].style.width = pageWidth + "px";
//         inner_item[i].style.height = pageHeight + "px";
//     }
//     inner.style.width = pageWidth * inner_item.length +"px";



//     function event_next(){
//         event_start = new Date().getTime();
//         var oldLeft = parseInt(inner.style.left);
//         if(event_start-event_end<1000){//1s内不得重复动作
//             return;
//         }
//         if(oldLeft<=-(inner_item.length-1)*pageWidth){
//             inner.style.left = 0 +"px";
//             event_end = new Date().getTime();
//             event_index=0;
//             event_showButton();
//             showEventPic();
//         }else{
//             inner.style.left = oldLeft - pageWidth +"px";
//             event_end = new Date().getTime();
//             event_index += 1;
//             event_showButton();
//             showEventPic();
//         }


//     }

//     function event_prev(){
//         event_start = new Date().getTime();
//         var oldLeft = parseInt(inner.style.left);
//         if(event_start-event_end<1000){//1s内不得重复动作
//             return;
//         }
//         if(oldLeft>=0){
//             inner.style.left = -((inner_item.length-1)*pageWidth) +"px";
//             event_end = new Date().getTime();
//             event_index = indicator_item.length-1;
//             event_showButton();
//             showEventPic()
//         }else{
//             inner.style.left = oldLeft + pageWidth +"px";
//             event_index -= 1;
//             event_end = new Date().getTime();
//             event_showButton();
//             showEventPic();
//         }

//     }
//     event_but_next.onclick = function(){
//         event_next();
//     }
//     event_but_prev.onclick = function(){
//         event_prev();
//     }
//     for(let i=0;i<indicator_item.length;i++){
//         indicator_item[i].onclick=function(){
//             if(i==event_index){
//                 return;
//             }
//             event_index = i;
//             event_showButton();
//             inner.style.left = (-i * pageWidth) + "px";
//             showEventPic();
//         }
//     }
//     function event_showButton(){
//         for(var j=0;j<indicator_item.length;j++){
//                 indicator_item[j].classList.remove("active");
//             }
//             indicator_item[event_index].classList.add("active");
//     }
//     function showEventPic(){
//         for(let i=0;i<event_image.length;i++){
//             if(event_image[i].style.opacity==1){
//                 event_image[i].style.transform = "scale(0.75,0.75)";
//                 event_image[i].style.opacity = 0;
//                 break;
//             }

//         }
//         setTimeout(function(){
//                     event_image[event_index].style.opacity=1;
//                     event_image[event_index].style.transform="scale(1,1)";


//                 },800);
//     }

};






